-- *****************************************************************
-- REDSTONE-LOG-MIB
--
-- Enterprise MIB
-- Extensions for Logging Management
--
-- Copyright 1999 Unisphere Solutions, Inc.
-- All Rights Reserved.
-- *****************************************************************

--
-- Brief Description of Logging Facility Model
--
-- A system application may support one or more 
-- logging categories. Each category can be separately
-- configured for severity and verbosity levels of the
-- logging messages it generates in reponse to category-
-- specific events. The severity level filters the generation
-- of messages; the verbosity level controls the content of
-- each generated message. Each category is resource-limited
-- in the rate of messages it can generate, thus high
-- event volume in one category will not exhaust common
-- resources to the extent that other log categories
-- are starved.
-- 
-- Generated log messages are recorded into a central
-- circular repository, called the log message table.
-- Each such recorded message is examined and can be 
-- sent to as many as three logging destinations: 
-- network-based SYSLOG server; local console; and local
-- nonvolatile log file. Each of these destinations is
-- separately configurable for severity level of messages
-- it wishes to receive.
--

REDSTONE-LOG-MIB DEFINITIONS ::= BEGIN

IMPORTS
    MODULE-IDENTITY,
    NOTIFICATION-TYPE,
    OBJECT-TYPE,
    Integer32,
    Counter32,
    Unsigned32,
    IpAddress
        FROM SNMPv2-SMI

    TEXTUAL-CONVENTION,
    DisplayString,
    RowStatus,
    TruthValue,
    TimeStamp,
    DateAndTime
        FROM SNMPv2-TC

    MODULE-COMPLIANCE,
    OBJECT-GROUP
        FROM SNMPv2-CONF

    rsMgmt
        FROM REDSTONE-SMI

    RsEnable,
    RsLogSeverity
        FROM REDSTONE-TC;
     

rsLogMIB MODULE-IDENTITY
    LAST-UPDATED    "9912310000Z"
    ORGANIZATION    "Unisphere Solutions Inc."
    CONTACT-INFO
        "
        Unisphere Solutions, Inc.
        5 Carlisle Road
        Westford MA 01886
        USA

        Tel:    +1-978-692-1999
        Email:  mib@redstonecom.com
        "
    DESCRIPTION
        "The Log MIB for the 
        Redstone Communications Inc. enterprise."
    REVISION      "9912310000Z"
    DESCRIPTION
        "Actually 27-Mar-2000. Replace single syslog destination
        with table of syslog destinations, and add syslog facility
        as an attribute for syslogs."
    REVISION      "9911080000Z"
    DESCRIPTION
        "Revise hierarchy of trap subtree so that MIB root node is
        enterprise for traps defined in this MIB. Rename logMsgCount
        to be logMsgLastSeqNumber."
    REVISION      "9909290000Z"
    DESCRIPTION
        "Initial version of this MIB module."
    ::= { rsMgmt 28 }

-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Textual conventions
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

RsLogCatName ::= TEXTUAL-CONVENTION
    STATUS      current
    DESCRIPTION
        "The name of a log category."
    SYNTAX      DisplayString(SIZE(1..32))

RsLogVerbosity ::= TEXTUAL-CONVENTION
    STATUS      current
    DESCRIPTION
        "The log verbosity level. Not all event types
        offer medium- or high-verbosity levels of detail."
    SYNTAX      INTEGER {   
                    low(0),
                    medium(1),
                    high(2)
                }

RsLogSyslogFacility ::= TEXTUAL-CONVENTION
    STATUS      current
    DESCRIPTION
        "The syslog daemon facility id."
    SYNTAX      INTEGER {
                    local0(0),
                    local1(1),
                    local2(2),
                    local3(3),
                    local4(4),
                    local5(5),
                    local6(6),
                    local7(7)
                }

-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Managed objects
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

rsLogObjects        OBJECT IDENTIFIER ::= { rsLogMIB 1 }


rsLogDestinations   OBJECT IDENTIFIER ::= { rsLogObjects 1 }
rsLogCategories     OBJECT IDENTIFIER ::= { rsLogObjects 2 }
rsLogMessages       OBJECT IDENTIFIER ::= { rsLogObjects 3 }

-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-- Log Destinations
-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

rsLogDestSyslog         OBJECT IDENTIFIER ::= { rsLogDestinations 1 }
rsLogDestConsole        OBJECT IDENTIFIER ::= { rsLogDestinations 2 }
rsLogDestNvFile         OBJECT IDENTIFIER ::= { rsLogDestinations 3 }

--
-- SYSLOG server log destination
--
-- Scalar objects supporting a single syslog destination
-- are obsoleted in favor of a table of syslog destinations.
--

rsLogDestSyslogSeverity OBJECT-TYPE
    SYNTAX      RsLogSeverity   
    MAX-ACCESS  read-write
    STATUS      obsolete
    DESCRIPTION
        "The minimum severity level of messages sent to the 
        SYSLOG server. A value of 'off' indicates no log 
        messages are sent to this destination."
    ::= { rsLogDestSyslog 1 }

rsLogDestSyslogAddress OBJECT-TYPE
    SYNTAX      IpAddress
    MAX-ACCESS  read-write
    STATUS      obsolete
    DESCRIPTION
        "The IP address of the SYSLOG server to which
        log messages are to be sent. A value of 0.0.0.0
        indicates no server address is configured."
    ::= { rsLogDestSyslog 2 }

rsLogSyslogTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF RsLogSyslogEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A table describing the characteristics of each
        syslog destination."
    ::= { rsLogDestSyslog 3 }

rsLogSyslogEntry OBJECT-TYPE
    SYNTAX      RsLogSyslogEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An entry describingthe characteristics of a 
        syslog destination."
    INDEX   { rsLogSyslogIpAddress }
    ::= { rsLogSyslogTable 1 }

RsLogSyslogEntry ::= SEQUENCE {
    rsLogSyslogIpAddress
        IpAddress,
    rsLogSyslogRowStatus
        RowStatus,
    rsLogSyslogSeverity
        RsLogSeverity,
    rsLogSyslogFacility
        RsLogSyslogFacility
}

rsLogSyslogIpAddress OBJECT-TYPE
    SYNTAX      IpAddress
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The IP address of this syslog destination.
        This value must be a unicast IP address."
    ::= { rsLogSyslogEntry 1 }

rsLogSyslogRowStatus OBJECT-TYPE
    SYNTAX      RowStatus
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "Controls creation/deletion of entries in this table.
        Only 'createAndGo' and 'destroy' are supported."
    ::= { rsLogSyslogEntry 2 }

rsLogSyslogSeverity OBJECT-TYPE
    SYNTAX      RsLogSeverity
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The severity level for this syslog destination.
        Setting this value to 'off' suppresses log messages
        from being sent to this syslog destination."
    DEFVAL { off }
    ::= { rsLogSyslogEntry 3 }

rsLogSyslogFacility OBJECT-TYPE
    SYNTAX      RsLogSyslogFacility
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
        "The facility id attached to messages sent to this
        syslog destination."
    DEFVAL { local7 }
    ::= { rsLogSyslogEntry 4 }

--
-- Local console log destination
--
rsLogDestConsoleSeverity OBJECT-TYPE
    SYNTAX      RsLogSeverity   
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The minimum severity level of messages sent to the 
        console. A value of 'off' indicates no log messages
        are sent to this destination."
    ::= { rsLogDestConsole 1 }

--
-- Local nonvolatile file log destination
--
rsLogDestNvFileSeverity OBJECT-TYPE
    SYNTAX      RsLogSeverity   
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The minimum severity level of messages sent to the
        nonvolatile log file. A value of 'off' indicates
        no log messages are to be sent to this destination."
    ::= { rsLogDestNvFile 1 }

-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-- Log Categories
-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

rsLogCatScalars        OBJECT IDENTIFIER ::= { rsLogCategories 1 }
-- reserved for attributes pertaining to all logs

-- 
-- Log Category Table
-- 
rsLogCatTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF RsLogCatEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A table describing the characteristics of each log category."
    ::= { rsLogCategories 2 }

rsLogCatEntry OBJECT-TYPE
    SYNTAX      RsLogCatEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An entry describing the characteristics of a log category." 
    INDEX   { rsLogCatIndex }
    ::= { rsLogCatTable 1 }

RsLogCatEntry ::= SEQUENCE {
    rsLogCatIndex
        Integer32,
    rsLogCatName
        RsLogCatName,
    rsLogCatDescr
        DisplayString,
    rsLogCatEngineering
        TruthValue,
    rsLogCatDiscards
        Counter32,
    rsLogCatSeverity
        RsLogSeverity,
    rsLogCatVerbosity
        RsLogVerbosity
    }

rsLogCatIndex OBJECT-TYPE
    SYNTAX      Integer32(1..2147483647)
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An integer index uniquely associated with a log.

        Index values do not necessarily persist across system
        reboots. Following reboot, mappings of (reboot-invariant)
        log category names to log index values is available in
        the rsLogCatNameTable."
    ::= { rsLogCatEntry 1 }

rsLogCatName OBJECT-TYPE
    SYNTAX      RsLogCatName
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The name of this log category."
    ::= { rsLogCatEntry 2 }

rsLogCatDescr OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "A description of the functionality for which events
        are recorded by this log category."
    ::= { rsLogCatEntry 3 }

rsLogCatEngineering OBJECT-TYPE
    SYNTAX      TruthValue
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "An indication of whether this log is intended mainly
        for engineering development and debug purposes."
    ::= { rsLogCatEntry 4 }

rsLogCatDiscards OBJECT-TYPE
    SYNTAX      Counter32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The number of messages generated by this log category
        that were discarded because of resource limitations."
    ::= { rsLogCatEntry 5 }

rsLogCatSeverity OBJECT-TYPE
    SYNTAX      RsLogSeverity
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The severity level for this log category. 

        The value 'off' disables recording of this log category's
        messages. For other severity level values, only messages
        at or above this severity level will be logged in rsLogMsgTable."
    ::= { rsLogCatEntry 6 }

rsLogCatVerbosity OBJECT-TYPE
    SYNTAX      RsLogVerbosity
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "The verbosity level for this log category.

        Supplementary information may be available for certain
        event types. This object controls whether that additional
        information, if available for a given event, is recorded."
    ::= { rsLogCatEntry 7}

--
-- Log Category Name Table
--
rsLogCatNameTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF RsLogCatNameEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A table mapping each log category's name to its index."
    ::= { rsLogCategories 3 }

rsLogCatNameEntry OBJECT-TYPE
    SYNTAX      RsLogCatNameEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "An entry mapping a log category's name to its index."
    INDEX   { IMPLIED rsLogCatNameName }
    ::= { rsLogCatNameTable 1 }

RsLogCatNameEntry ::= SEQUENCE {
    rsLogCatNameName
        RsLogCatName,
    rsLogCatNameIndex
        Integer32
    }

rsLogCatNameName OBJECT-TYPE
    SYNTAX      RsLogCatName
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The name of the log category."
    ::= { rsLogCatNameEntry 1 }

rsLogCatNameIndex OBJECT-TYPE
    SYNTAX      Integer32 (1..2147483647)
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The log index associated with this log category."
    ::= { rsLogCatNameEntry 2 }


-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-- Log Messages
-- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

--
-- Log Message Scalars
--
rsLogMsgScalars     OBJECT IDENTIFIER   ::= { rsLogMessages 1 }

rsLogMsgCapacity OBJECT-TYPE
    SYNTAX      Integer32
    UNITS       "messages"
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The maximum capacity, in number of log messages, of
        the rsLogMsgTable."
    ::= { rsLogMsgScalars 1 }

rsLogMsgLastSeqNumber OBJECT-TYPE
    SYNTAX      Counter32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The sequence number of the most recent rsLogMsgTable entry.

        By monitoring this object's rate of change in relation to
        the rsLogMsgTable capacity, a management client can determine
        whether it is polling rsLogMsgTable frequently enough to avoid
        missing log messages."
    ::= { rsLogMsgScalars 2 }


--
-- Log Message Table
--
rsLogMsgTable OBJECT-TYPE
    SYNTAX      SEQUENCE OF RsLogMsgEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A table of log messages generated by this device."
    ::= { rsLogMessages 2 }

rsLogMsgEntry OBJECT-TYPE
    SYNTAX      RsLogMsgEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A log message generated by this device."
    INDEX   { rsLogMsgSysUpTimeStamp, rsLogMsgSequenceNumber }
    ::= { rsLogMsgTable 1 }

RsLogMsgEntry ::= SEQUENCE {
    rsLogMsgSysUpTimeStamp
        TimeStamp,
    rsLogMsgSequenceNumber
        Unsigned32,
    rsLogMsgCatName
        RsLogCatName,
    rsLogMsgCatIndex
        Integer32,
    rsLogMsgSeverity
        RsLogSeverity,
    rsLogMsgText
        DisplayString,
    rsLogMsgDateAndTimeStamp
        DateAndTime
    }

rsLogMsgSysUpTimeStamp OBJECT-TYPE
    SYNTAX      TimeStamp
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "The value of sysUpTime when this log message was recorded."
    ::= { rsLogMsgEntry 1 }

rsLogMsgSequenceNumber OBJECT-TYPE
    SYNTAX      Unsigned32
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
        "A sequence number that uniquely identifies this entry. Sequence
        numbers are assigned consecutively beginning with 1. More recent
        entries have higher sequence numbers."
    ::= { rsLogMsgEntry 2 }

rsLogMsgCatName OBJECT-TYPE
    SYNTAX      RsLogCatName
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "Name of the log category that contributed this message."
    ::= { rsLogMsgEntry 3 }

rsLogMsgCatIndex OBJECT-TYPE
    SYNTAX      Integer32
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "Index of the log category that contributed this message."
    ::= { rsLogMsgEntry 4 }

rsLogMsgSeverity OBJECT-TYPE
    SYNTAX      RsLogSeverity
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The severity of the message."
    ::= { rsLogMsgEntry 5 }

rsLogMsgText  OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The text of the log message.
        
        Truncation of log message text is indicated by
        n asterisk character ('*') in the last octet of 
        a maximum-size string."
    ::= { rsLogMsgEntry 6 }

rsLogMsgDateAndTimeStamp  OBJECT-TYPE
    SYNTAX      DateAndTime
    MAX-ACCESS  read-only
    STATUS      current
    DESCRIPTION
        "The date and time this message was generated."
    ::= { rsLogMsgEntry 7 }


-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Notification control objects
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

rsLogTrapControl      OBJECT IDENTIFIER ::= { rsLogMIB 2 }

rsLogMsgThreshold OBJECT-TYPE
    SYNTAX      Integer32(0..100)
    UNITS       "percent"
    MAX-ACCESS  read-write
    STATUS      current
    DESCRIPTION
        "Number of log messages which, when added to rsLogMsgTable,
        cause a rsLogMsgThresholdTrap to be generated.
        
        This value is expressed as a percentage of the capacity of
        rsLogMsgTable. A value of zero disables trap generation."
    ::= { rsLogTrapControl 1 }


-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Notifications
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-- The following OBJECT IDENTIFIERS is used to define SNMPv2 
-- Notifications that are easily translated into SNMPv1 Traps.

rsLogTrapPrefix         OBJECT IDENTIFIER ::= { rsLogMIB 0 }

rsLogMsgThresholdTrap NOTIFICATION-TYPE
    OBJECTS {
        rsLogMsgCapacity,
        rsLogMsgLastSeqNumber,
        rsLogMsgThreshold
        }
    STATUS      current
    DESCRIPTION
        "This trap is generated to report that an incremental number
        of log messages (described by the value of rsLogMsgThreshold)
        have  been added to rsLogMsgTable."
    ::= { rsLogTrapPrefix 1 }

-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Conformance information
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

rsLogMIBConformance
             OBJECT IDENTIFIER ::= { rsLogMIB 4 }
rsLogMIBCompliances
             OBJECT IDENTIFIER ::= { rsLogMIBConformance 1 }
rsLogMIBGroups
             OBJECT IDENTIFIER ::= { rsLogMIBConformance 2 }


-- compliance statements

rsLogCompliance MODULE-COMPLIANCE
    STATUS  obsolete
    DESCRIPTION
        "The compliance statement for entities which implement
        the Unisphere Solutions Inc. Log MIB."
    MODULE  -- this module
    MANDATORY-GROUPS { rsLogGroup }
    ::= { rsLogMIBCompliances 1 }

rsLogCompliance2 MODULE-COMPLIANCE
    STATUS  current
    DESCRIPTION
        "The compliance statement for entities which implement
        the Unisphere Solutions Inc. Log MIB., including support
        for multiple SYSLOG destinations."
    MODULE  -- this module
    MANDATORY-GROUPS { rsLogGroup2 }
    ::= { rsLogMIBCompliances 2 }

-- units of conformance

rsLogGroup OBJECT-GROUP
    OBJECTS {
        -- log destinations
        rsLogDestSyslogSeverity,
        rsLogDestSyslogAddress,
        rsLogDestConsoleSeverity,
        rsLogDestNvFileSeverity,

        -- log categories
        rsLogCatName,
        rsLogCatDescr,
        rsLogCatEngineering,
        rsLogCatDiscards,
        rsLogCatSeverity,
        rsLogCatVerbosity,

        -- log category names
        rsLogCatNameName,
        rsLogCatNameIndex,

        -- log message scalars
        rsLogMsgCapacity,
        rsLogMsgLastSeqNumber,

        -- log messages
        rsLogMsgCatName,
        rsLogMsgCatIndex,
        rsLogMsgSeverity,
        rsLogMsgText,
        rsLogMsgDateAndTimeStamp,

        -- trap control
        rsLogMsgThreshold
    }
    STATUS  obsolete
    DESCRIPTION
        "A collection of objects providing management of
        Unisphere Solutions Inc. logging capabilities."
    ::= { rsLogMIBGroups 1 }
    
rsLogGroup2 OBJECT-GROUP
    OBJECTS {
        -- log destinations
        rsLogSyslogRowStatus,
        rsLogSyslogSeverity,
        rsLogSyslogFacility,
        rsLogDestConsoleSeverity,
        rsLogDestNvFileSeverity,

        -- log categories
        rsLogCatName,
        rsLogCatDescr,
        rsLogCatEngineering,
        rsLogCatDiscards,
        rsLogCatSeverity,
        rsLogCatVerbosity,

        -- log category names
        rsLogCatNameName,
        rsLogCatNameIndex,

        -- log message scalars
        rsLogMsgCapacity,
        rsLogMsgLastSeqNumber,

        -- log messages
        rsLogMsgCatName,
        rsLogMsgCatIndex,
        rsLogMsgSeverity,
        rsLogMsgText,
        rsLogMsgDateAndTimeStamp,

        -- trap control
        rsLogMsgThreshold
    }
    STATUS  current
    DESCRIPTION
        "A collection of objects providing management of
        Unisphere Solutions Inc. logging capabilities, 
        including support for multiple SYSLOG destinations."
    ::= { rsLogMIBGroups 2 }
    
END